home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / gui / MR_Classes.lha / MR_Classes / Dev / AutoDocs / supermodel_class.doc < prev    next >
Encoding:
Text File  |  2000-09-05  |  13.5 KB  |  587 lines

  1. TABLE OF CONTENTS
  2.  
  3. supermodel.class/--datasheet--
  4. supermodel.class/--datasheet-GlueFunc--
  5. supermodel.class/--datasheet-supericclass--
  6. supermodel.class/--History--
  7. supermodel.class/ProcessTagList
  8. supermodel.class/SM_IsMemberOf
  9. supermodel.class/SM_NewSuperIC
  10. supermodel.class/SM_NewSuperModel
  11. supermodel.class/SM_SendGlueAttrs
  12. supermodel.class/SM_SICMAP
  13. supermodel.class/SMTAG_AddTag
  14. supermodel.class/SMTAG_AddTags
  15. supermodel.class/SMTAG_AllocTags
  16. supermodel.class/SMTAG_ClearNumTags
  17. supermodel.class/SMTAG_ClearTags
  18. supermodel.class/SMTAG_FreeTags
  19. supermodel.class/SMTAG_RemTag
  20. supermodel.class/SMTAG_TagDone
  21. supermodel.class/SMTAG_TagMore
  22. supermodel.class/--datasheet--                 supermodel.class/--datasheet--
  23.  
  24.    NAME
  25.        supermodel.class -- Model and IC class
  26.  
  27.    SUPERCLASS
  28.        modelclass
  29.  
  30.    DESCRIPTION
  31.        
  32.  
  33.    METHODS
  34.        
  35.  
  36.    ATTRIBUTES
  37.        SMA_AddMember - calls OM_ADDMEMBER
  38.  
  39.        SMA_RemMember - calls OM_REMMEMBER
  40.  
  41.        SMA_GlueFunc - Glue code, does tag mapping/conversion, etc.  
  42.            See example.
  43.            see --datasheet-GlueFunc--
  44.  
  45.        SMA_GlueFuncA6 - If your glue code is in a library, set this to
  46.            your Library base.
  47.  
  48.        SMA_GlueFuncUserData - 
  49.  
  50.        SMA_CacheStringTag - cache string data
  51.  
  52.        icclass Tags supported also
  53.  
  54.    NOTES
  55.  
  56.    BUGS
  57.        Doesn't fail if SMA_AddMember is NULL during OM_NEW.
  58.        It will in the future.
  59.  
  60.    SEE ALSO
  61.  
  62. supermodel.class/--datasheet-GlueFunc--upermodel.class/--datasheet-GlueFunc--
  63.  
  64.    NAME
  65.        GlueFunc
  66.  
  67.    SYNOPSIS
  68.        rv GlueFunc(GlueData, TagList, [userdata], [a6])
  69.        d0          a0        a1       a2          a6
  70.        
  71.        ULONG GlueFunc(struct smGlueData *, struct TagItem *, APTR, APTR);
  72.  
  73.    FUNCTION
  74.        GlueFunc is a function you provide to modify a tag list before
  75.        being sent to the members and ICA_TARGET of the modelclass.
  76.  
  77.        You may modify TagList and use the SMTAG_functions to modify 
  78.        TagList, however, don't free TagList.
  79.        
  80.        Call SM_SendGlueAttrsA() to send your new attributes back to the
  81.        model class for notifiaction.
  82.  
  83.    NOTES
  84.        There is room for 50 tags in TagList
  85.  
  86.    BUGS
  87.  
  88.    SEE ALSO
  89.  
  90. supermodel.class/--datasheet-supericclass--l.class/--datasheet-supericclass--
  91.  
  92.    NAME
  93.        supermodel.class -- IC class
  94.  
  95.    SUPERCLASS
  96.        icclass
  97.  
  98.    DESCRIPTION
  99.        An interconnect object, creates a data path between a supermodel
  100.        object and other objects (usually gadgets)
  101.  
  102.    METHODS
  103.  
  104.    ATTRIBUTES
  105.          SICA_Model - set by model class when addmembered.
  106.  
  107.          ICA_TARGET - target object
  108.  
  109.          You may set either ICA_MAP or SICA_TargetMap or 
  110.            (SICA_ToTargetMap and SICA_FromTargetMap)
  111.  
  112.          ICA_MAP - map tags
  113.            The supplied taglist is cloned and applied to the ic object.
  114.            Another taglist is built by reversing the tags and applied to 
  115.              the targeted object.
  116.  
  117.          SICA_TargetMap -
  118.            The supplied taglist is cloned and applied to the targeted object.
  119.            Another taglist is built by reversing the tags and applied to 
  120.              the ic object.
  121.  
  122.          SICA_ToTargetMap - Applied to tags sent from the
  123.                             ic object to the targeted object.
  124.  
  125.          SICA_FromTargetMap - Applied to tags sent from the
  126.                    targeted object to, likely, the modelobject
  127.  
  128.  
  129.    NOTES
  130.        if ICA_TARGET is valid,
  131.        the ic object will set the Target's ICA_TARGET and ICA_MAP.
  132.  
  133.    BUGS
  134.  
  135.    SEE ALSO
  136.  
  137. supermodel.class/--History--                     supermodel.class/--History--
  138.  
  139.    To Do
  140.  
  141.    44.1 -
  142.        * GlueCode was freeing memory twice.
  143.        * Added SMA_CacheStringTag - Anytime this tag is passed through
  144.          the model class, the string supplied is cached, and ti_Data
  145.          is updated to point to the cache.
  146.    44.2 - 
  147.        * Included version string
  148.    44.3 -
  149.        * Now failes during OM_NEW if any SMA_AddMember is null.
  150.        * Documentation update.
  151.        * ICA_MAP support in superic was changed
  152.  
  153. supermodel.class/ProcessTagList               supermodel.class/ProcessTagList
  154.  
  155.    NAME
  156.        ProcessTagList -- Macro to process a taglist
  157.  
  158.    SYNOPSIS
  159.        ProcessTagList(TagList, Tag, TState)
  160.  
  161.        TState=TagList; 
  162.        while(Tag=NextTagItem(&TState))
  163.  
  164.    EXAMPLE
  165.        void SomeFunc(struct TagItem *TagList)
  166.        {
  167.          struct TagItem *tag, *tstate;
  168.  
  169.          ProcessTagList(TagList,tag,tstate)
  170.          {
  171.            seitch(tag->ti_Tag)
  172.            {
  173.              case GA_Left:
  174.                ...
  175.                break;
  176.              etc...
  177.            }
  178.          }
  179.        }
  180.  
  181. supermodel.class/SM_IsMemberOf                 supermodel.class/SM_IsMemberOf
  182.  
  183.    NAME
  184.        SM_IsMemberOf -- Check if Object belongs to a Class
  185.  
  186.    SYNOPSIS
  187.        memberof = SM_IsMemberOf(Object, ClassPtr, ClassID)
  188.  
  189.        BOOL SM_IsMemberOf(Object *, Class *, STRPTR);
  190.  
  191.    FUNCTION
  192.        Determines if the Object is a member of the Class
  193.        specified.
  194.  
  195.    INPUTS
  196.        Object   - Object to check.
  197.        ClassPtr - (Class) May be NULL.
  198.        ClassID  - (STRPTR) May be NULL. 
  199.  
  200.    RESULT
  201.        BOOL, non-zero on succes.
  202.  
  203.    NOTES
  204.        Stolen from someone on the BOOPSI mailing list...
  205.           
  206.        Here's some IsMemberOf() code I whipped up quickly.  Might be nice if 
  207. we all
  208.        posted useful little BOOPSI snippets like this... maybe even collected
  209.  them
  210.        together on a web site.  (I volunteer NOT to maintain this site :)
  211.  
  212. supermodel.class/SM_NewSuperIC                 supermodel.class/SM_NewSuperIC
  213.  
  214.    NAME
  215.        SM_NewSuperIC -- Allocate SuperIC object
  216.  
  217.    SYNOPSIS
  218.        icobject=SM_NewSuperICA(TagList)
  219.        a0                      a0
  220.  
  221.        Object *SM_NewSuperICA(struct TagItem *);
  222.  
  223.        icobject=SM_NewSuperIC(Tags, ...)
  224.        a0                     a0
  225.  
  226.        Object *SM_NewSuperIC(Tag, ...);
  227.  
  228.    FUNCTION
  229.        Allocates an SuperIC class object
  230.  
  231.    INPUTS
  232.        TagList - see --datasheet-supericclass--
  233.  
  234.    RESULT
  235.        Pointer to an ic object on success, if ICA_TARGET is valid,
  236.        the ic object will set the Target's ICA_TARGET and ICA_MAP.
  237.  
  238. supermodel.class/SM_NewSuperModel           supermodel.class/SM_NewSuperModel
  239.  
  240.    NAME
  241.        SM_NewSuperModel -- Allocate SuperModel object
  242.  
  243.    SYNOPSIS
  244.        model = SM_NewSuperModel( Tag1, Data1, TAg2, ...)
  245.  
  246.        Object *SM_NewSuperModel(Tag Tags, ...);
  247.  
  248.    FUNCTION
  249.        Allocate model object.
  250.  
  251.    INPUTS
  252.        Tags
  253.  
  254.    RESULT
  255.  
  256.    EXAMPLE
  257.  
  258.    NOTES
  259.        DisposeObject() returned model when done.
  260.  
  261.        Before targeted objects (ie gadgets) are freed you must either:
  262.        1. Dispose() the SuperModel object, which also Dispose()s all
  263.            SuperIC objects.
  264.        2. SetAttr() ICA_TARGET to NULL on every SuperIC object.
  265.        SuperIC objects need to clear the ICA_MAP and ICA_TARGET settings 
  266.        of it's targetted object.  If the target object nolonger exists,
  267.        expect bad things to happen.
  268.  
  269.    BUGS
  270.  
  271.    SEE ALSO
  272.  
  273. supermodel.class/SM_SendGlueAttrs           supermodel.class/SM_SendGlueAttrs
  274.  
  275.    NAME
  276.        SM_SendGlueAttrs -- Send attributes from GlueFunc (SMA_GlueFunc)
  277.  
  278.    SYNOPSIS
  279.        unknown = SM_SendGlueAttrs(GlueData, TagList)
  280.        d0                         a0        a1
  281.  
  282.        ULONG SM_SendGlueAttrs(struct smGlueData *, struct TagItem *);
  283.  
  284.    FUNCTION
  285.        This function sends TagList back to the modelclass for notification
  286.        of other objects.
  287.  
  288.        ONLY to be called from inside a GlueFunction.
  289.  
  290.    INPUTS
  291.        GlueData - 
  292.        TagList -
  293.  
  294.    RESULT
  295.  
  296.    EXAMPLE
  297.  
  298.    NOTES
  299.  
  300.    BUGS
  301.  
  302.    SEE ALSO
  303.  
  304. supermodel.class/SM_SICMAP                         supermodel.class/SM_SICMAP
  305.  
  306.    NAME
  307.        SM_SICMAP -- Builds and super ic class object
  308.  
  309.    SYNOPSIS
  310.        icobject SM_SICMAPA(Target, MapTags)
  311.        a0                  a0      a1
  312.  
  313.        Object *SM_SICMAPA(Object *, struct TagItem *);
  314.  
  315.        icobject=SM_SICMAP(Target, MapTags, ...)
  316.        a0                 a0      a1
  317.  
  318.        Object *SM_SICMAP(Object *, Tag, ...);
  319.  
  320.    FUNCTION
  321.        Simplfied way to create and SuperIC object.
  322.        Target is targeted object of the ic object.
  323.        MapTags, target map tags.
  324.  
  325.    INPUTS
  326.  
  327.    RESULT
  328.  
  329.    EXAMPLE
  330.  
  331.    NOTES
  332.  
  333.    BUGS
  334.  
  335.    SEE ALSO
  336.  
  337. supermodel.class/SMTAG_AddTag                   supermodel.class/SMTAG_AddTag
  338.  
  339.    NAME
  340.        SMTAG_AddTag -- Add a tag toa taglist.
  341.  
  342.    SYNOPSIS
  343.        ok = SMTAG_AddTag(TagList, Tag, Data)
  344.  
  345.        BOOL SMTAG_AddTag(struct TagItem *, ULONG, ULONG);
  346.  
  347.    FUNCTION
  348.        Add a tag pair to a taglist created with SMTAG_AllocTags()
  349.  
  350.    INPUTS
  351.        TagList - TagList created with SMTAG_AllocTags()
  352.        Tag - ti_Tag value
  353.        Data - ti_Data value
  354.  
  355.    RESULT
  356.        non zero if the tag was added.
  357.        failure can be due to under sized taglist.
  358.  
  359.    EXAMPLE
  360.        see SMTAG_AllocTags()
  361.  
  362.    NOTES
  363.        Don't SMTAG_AddTag TAG_IGNORE, TAG_DONE, TAG_MORE, TAG_SKIP.
  364.        This function will only effect the specified TagList, and 
  365.        not any other lists referenced by TAG_MORE.
  366.        This function overwrites existing same tags.
  367.  
  368.    SEE ALSO
  369.        SMTAG_AllocTags()
  370.  
  371. supermodel.class/SMTAG_AddTags                 supermodel.class/SMTAG_AddTags
  372.  
  373.    NAME
  374.        SMTAG_AddTags -- Add a taglist to a taglist.
  375.  
  376.    SYNOPSIS
  377.        ok = SMTAG_AddTags(TagList, Tag, Data)
  378.  
  379.        BOOL SMTAG_AddTags(struct TagItem *, ULONG, ULONG);
  380.  
  381.    FUNCTION
  382.        Add a taglist to a taglist created with SMTAG_AllocTags()
  383.  
  384.    INPUTS
  385.        TagList - TagList created with SMTAG_AllocTags()
  386.        NewTags - Tags to add to TagList
  387.  
  388.    RESULT
  389.        non zero if the tag was added.
  390.        failure can be due to under sized taglist.
  391.  
  392.    EXAMPLE
  393.        see SMTAG_AllocTags()
  394.  
  395.    NOTES
  396.        This function will only effect the specified TagList, and 
  397.        not any other lists referenced by TAG_MORE.
  398.        This function overwrites existing same tags.
  399.  
  400.    SEE ALSO
  401.        SMTAG_AllocTags()
  402.  
  403. supermodel.class/SMTAG_AllocTags             supermodel.class/SMTAG_AllocTags
  404.  
  405.    NAME
  406.        SMTAG_AllocTags -- Allocate blank Tag List
  407.  
  408.    SYNOPSIS
  409.        taglist = SMTAG_AllocTags(TagCount)
  410.  
  411.        struct TagItem *SMTAG_AllocTags(ULONG);
  412.  
  413.    FUNCTION
  414.        Allocate tag space for use with other SMTAG_? functions.
  415.  
  416.    INPUTS
  417.        TagCount - Number of blank tags to allocate.
  418.  
  419.    RESULT
  420.        An empty tag space ending with TAG_DONE, or NULL.
  421.  
  422.    EXAMPLE
  423.  
  424.    NOTES
  425.  
  426.    BUGS
  427.  
  428.    SEE ALSO
  429.  
  430. supermodel.class/SMTAG_ClearNumTags       supermodel.class/SMTAG_ClearNumTags
  431.  
  432.    NAME
  433.        SMTAG_ClearTags -- Clear a TagList
  434.  
  435.    SYNOPSIS
  436.        void SMTAG_ClearTags(TagList, TagCount)
  437.  
  438.        SMTAG_ClearTags(struct TagItem *, ULONG);
  439.  
  440.    FUNCTION
  441.        Clears the TagList of all data.
  442.  
  443.    INPUTS
  444.        TagList - Allocated with SMTAG_AllocTags()
  445.        TagCount - Number of blank tags to allocate.
  446.  
  447.    EXAMPLE
  448.        see SMTAG_AllocTags()
  449.  
  450.    NOTES
  451.        This function is called by SMTAG_AllocTags(), so
  452.        the taglist is cleared when allocated.
  453.        This function will only effect the specified TagList, and 
  454.        not any other lists referenced by TAG_MORE.
  455.  
  456.    BUGS
  457.  
  458.    SEE ALSO
  459.        see SMTAG_AllocTags()
  460.  
  461. supermodel.class/SMTAG_ClearTags             supermodel.class/SMTAG_ClearTags
  462.  
  463.    NAME
  464.        SMTAG_ClearTags -- Clear a TagList
  465.  
  466.    SYNOPSIS
  467.        void SMTAG_ClearTags(TagList)
  468.  
  469.        SMTAG_ClearTags(struct TagItem *);
  470.  
  471.    FUNCTION
  472.        Clears the TagList of all data.
  473.  
  474.    INPUTS
  475.        TagList - Allocated with SMTAG_AllocTags()
  476.  
  477.    EXAMPLE
  478.        see SMTAG_AllocTags()
  479.  
  480.    NOTES
  481.        This function will only effect the specified TagList, and 
  482.        not any other lists referenced by TAG_MORE.
  483.  
  484.    BUGS
  485.  
  486.    SEE ALSO
  487.        see SMTAG_AllocTags()
  488.  
  489. supermodel.class/SMTAG_FreeTags               supermodel.class/SMTAG_FreeTags
  490.  
  491.    NAME
  492.        SMTAG_FreeTags -- Clear a TagList
  493.  
  494.    SYNOPSIS
  495.        void SMTAG_FreeTags(TagList)
  496.  
  497.        SMTAG_FreeTags(struct TagItem *);
  498.  
  499.    FUNCTION
  500.        Frees the TagList.
  501.  
  502.    INPUTS
  503.        TagList - Allocated with SMTAG_AllocTags().
  504.  
  505.    EXAMPLE
  506.        see SMTAG_AllocTags()
  507.  
  508.    SEE ALSO
  509.        see SMTAG_AllocTags()
  510.  
  511. supermodel.class/SMTAG_RemTag                   supermodel.class/SMTAG_RemTag
  512.  
  513.    NAME
  514.        SMTAG_RemTag -- Removea a tag to a taglist.
  515.  
  516.    SYNOPSIS
  517.        ok = SMTAG_RemTag(TagList, Tag)
  518.  
  519.        BOOL SMTAG_RemTag(struct TagItem *, ULONG);
  520.  
  521.    FUNCTION
  522.        Find and remove a tag from a taglist.
  523.  
  524.    INPUTS
  525.        TagList - TagList created with SMTAG_AllocTags()
  526.        Tag - ti_Tag value
  527.  
  528.    RESULT
  529.        non zero if the tag was found and removed.
  530.  
  531.    EXAMPLE
  532.        see SMTAG_AllocTags()
  533.  
  534.    NOTES
  535.        Don't SMTAG_AddTag TAG_IGNORE, TAG_DONE, TAG_MORE, TAG_SKIP.
  536.        This function will only effect the specified TagList, and 
  537.        not any other lists referenced by TAG_MORE.
  538.  
  539.    SEE ALSO
  540.        SMTAG_AllocTags()
  541.  
  542. supermodel.class/SMTAG_TagDone                 supermodel.class/SMTAG_TagDone
  543.  
  544.    NAME
  545.        SMTAG_TagDone -- End the TagList with TagDone
  546.  
  547.    SYNOPSIS
  548.        void SMTAG_FreeTags(TagList)
  549.  
  550.        SMTAG_FreeTags(struct TagItem *);
  551.  
  552.    FUNCTION
  553.        Ends the taglist with TAG_MORE and link the list to MoreTags
  554.  
  555.    INPUTS
  556.        TagList - Allocated with SMTAG_AllocTags().
  557.  
  558.    EXAMPLE
  559.        see SMTAG_AllocTags()
  560.  
  561.    SEE ALSO
  562.        see SMTAG_AllocTags()
  563.  
  564. supermodel.class/SMTAG_TagMore                 supermodel.class/SMTAG_TagMore
  565.  
  566.    NAME
  567.        SMTAG_TagMore -- End the TagList with TagMore
  568.  
  569.    SYNOPSIS
  570.        void SMTAG_FreeTags(TagList, MoreTags)
  571.  
  572.        SMTAG_FreeTags(struct TagItem *, struct TagItem *);
  573.  
  574.    FUNCTION
  575.        Ends the taglist with TAG_MORE and link the list to MoreTags
  576.  
  577.    INPUTS
  578.        TagList - Allocated with SMTAG_AllocTags().
  579.        MoreTags - Tags to link
  580.  
  581.    EXAMPLE
  582.        see SMTAG_AllocTags()
  583.  
  584.    SEE ALSO
  585.        see SMTAG_AllocTags()
  586.  
  587.